load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("build_infra")

source_listing()

erlang_application(
    name = "test_exec",
    srcs = glob([
        "src/*.erl",
        "src/*.hrl",
    ]),
    app_src = "src/test_exec.app.src",
    applications = [
        "kernel",
        "stdlib",
        "prelude//erlang/common_test/common:common",
        "prelude//erlang/common_test/cth_hooks:cth_hooks",
    ],
    erl_opts = [
        "+debug_info",
        "+warnings_as_errors",
    ],
    includes = glob(["include/*.hrl"]),
    mod = ("test_exec", "[]"),
    resources = read_root_config("erlang", "erlang_tests_default_config", "").split(),
    shell_libs = [],
    use_global_parse_transforms = False,
    visibility = ["PUBLIC"],
)

erlang_tests(
    contacts = ["whatsapp_testing_infra"],
    labels = ["unit"],
    suites = ["test/ct_executor_SUITE.erl"],
    deps = [
        "stdlib",
        ":test_exec",
    ],
)
